#!/usr/bin/env ruby

# https://cirosantilli.com/linux-kernel-module-cheat#asciidoctor-extract-link-targets

require 'asciidoctor'
require 'asciidoctor/extensions'

class Main < Asciidoctor::Extensions::InlineMacroProcessor
  use_dsl
  named :link
  def process parent, target, attrs
    puts target
  end
end

Asciidoctor::Extensions.register do
  inline_macro Main
end

(Asciidoctor.load_file(ARGV[0])).convert
